// 路由-相关模块
import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '@/views/Home'
import Layout from '@/views/Layout'
import Play from '@/views/Play'
import Search from '@/views/Search'

Vue.use(VueRouter)
const routes = [
  {
    path: '/',
    redirect: '/Layout',
  },
  {
    // Layout是展示内容，上下固定的块，它的下面有两个切换的页面，首页和搜索
    path: '/Layout',
    component: Layout,
    redirect: '/Layout/Home',
    children: [
      {
        path: 'Home',
        component: Home,
        meta: {
          title: '首页',
        },
      },
      {
        path: 'Search',
        component: Search,
        meta: {
          title: '搜索',
        },
        children: [
          {
            path: 'PPlay',
            component: Play,
          },
        ],
      },
      {
        path: 'Play',
        component: Play,
      },
    ],
  },
]
const router = new VueRouter({
  routes,
})
export default router
